package com.shycloud.mido.common.security.feign;

import com.shycloud.mido.common.core.constant.CommonConstants;
import com.shycloud.mido.common.core.util.R;
import lombok.Getter;

/**
 * Fegin 异常
 *
 * @author L.cm
 */
public class ShyFeignException extends RuntimeException {
	@Getter
	private final R result;

	public ShyFeignException(R result) {
		super(result.getMsg());
		this.result = result;
	}

	public ShyFeignException(String message) {
		super(message);
		this.result = R.builder()
				.code(CommonConstants.FAIL)
				.msg(message).build();
	}

	/**
	 * 提高性能
	 *
	 * @return {Throwable}
	 */
	@Override
	public Throwable fillInStackTrace() {
		return this;
	}
}
